<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"  %>
<script type="text/javascript">
$.unblockUI();
function confirmOperation(operation) {
	return confirm("Desea " + operation + "?");
}

function viewTask(id_){
	$.post('./task/viewTask.action',{id:id_},function(resultadoHTML) {
		$('#content').html(resultadoHTML);
	});
}

function modifyTask(id_){
	$.post('./task/modifyTask.action',{id:id_},function(resultadoHTML) {
		$('#content').html(resultadoHTML);
	});
}
</script>


<div class="page-header">
  <h1>Task List</h1>
</div>

<table class="table table-striped">
	<thead>
	<tr>
		<th>ID</th>
		<th>TASK NAME</th>
		<th>DESCRIPTION</th>
		<th>OPTIONS</th>
	</tr>
	</thead>
	
	<s:iterator value="tasks">
		<tr>	
			<td><s:property value="id" /></td>
			<td><s:property value="title" /></td>
			<td><s:property value="description" />
			<td>
				<a href="#" onclick="viewTask(<s:property value="id" />)" class="btn btn-mini"><i class="icon-search"></i>view</a>
				<a href="#" onclick="modifyTask( <s:property value="id" />)" class="btn btn-mini  btn-info"><i class="icon-pencil"></i>edit</a>
			</td>
		</tr>
	</s:iterator>
</table>